From: Jasper St. Pierre Date: Thu, 16 Aug 2012 17:48:22 +0000 (-0400) Subject: grabHelper: Make sure to call onUngrabbed for all popped actors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6132 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3031036cb038602dcd8597a8e3c2ed4eb15db9e2;p=gnome-shell.git grabHelper: Make sure to call onUngrabbed for all popped actors --- diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index a330c04a3..780377ff9 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -207,6 +207,7 @@ const GrabHelper = new Lang.Class({ return; let poppedGrab = this._grabStack[grabStackIndex]; + let poppedGrabs = this._grabStack.slice(grabStackIndex); // "Pop" poppedGrab and everything after off by truncating the array. this._grabStack.length = grabStackIndex; @@ -218,8 +219,10 @@ const GrabHelper = new Lang.Class({ let focus = global.stage.key_focus; let hadFocus = focus && this._isWithinGrabbedActor(focus); - if (poppedGrab.onUngrab) - poppedGrab.onUngrab(); + for (let i = 0; i < poppedGrabs.length; i++) { + if (poppedGrabs[i].onUngrab) + poppedGrabs[i].onUngrab(); + } // If we took away the last grab, ungrab ourselves. if (this._grabStack.length == 0)